package cn.wolfcode.trip.api.controller;

import cn.wolfcode.trip.base.domain.InterestingPeople;
import cn.wolfcode.trip.base.mapper.InterestingPeopleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/interestingPeople")
public class InterestingPeopleController {

    @Autowired
    private InterestingPeopleMapper interestingPeopleMapper;

    @GetMapping("{userId}")
    public List<InterestingPeople> queryByUserId(@PathVariable Long userId) {
        return interestingPeopleMapper.selectByUserId(userId);
    }
}
